<%-- 
    Document   : previewMessage
    Created on : 20-nov-2008, 20:07:08
    Author     : org.@le

--%>

<%@taglib uri="http://richfaces.org/a4j" prefix="a4j"%>
<%@taglib uri="http://richfaces.org/rich" prefix="rich"%>

<%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
<%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body onload="reloadAjaxPanels()">
        
        <f:view>
            <h:form>
                <a4j:jsFunction name="reloadAjaxPanels"
                                reRender="buttons" />
                <rich:panel header="Vista previa del mensaje" style="width: 100%" id="mensajei">
                    <h:outputText value="#{ForumsSession.currentMessage.subject}" /><br>
                    <h:outputText value="<#{ForumsRequest.currentDate}>" >
                        <f:convertDateTime type="date" dateStyle="medium" />
                    </h:outputText><br>
                    <h:outputText value="Publicado por: #{ForumsSession.findNick.name}" /><br><br>
                    <h:outputText value="#{ForumsSession.currentMessage.content}" /><br>
                </rich:panel>
                <rich:panel id="buttons" style="border:0px" >
                    <rich:panel style="border:0px" rendered="#{!ForumsSession.created}">
                        <h:commandButton value="Guardar" action="#{ForumsSession.createMessage}">
                            <a4j:support event="onclick" oncomplete="parent.frames['menu'].window.location.reload();" />
                        </h:commandButton>
                        <h:commandButton value="Editar" action="eMessage" immediate="true"/>
                    </rich:panel>
                </rich:panel>
            </h:form> 
        </f:view>
    </body>
</html>
